package com.pfzy.utildemo.utils;

import android.content.Context;
import android.content.Intent;
import android.os.Build;

import com.pfzy.utildemo.activity.record.recording2.RecordService;

public class ServiceUtil {
    /**
     * 启动录音服务
     * @param context
     * @param driverId
     * @param orderId
     */
    public static void startRecordService(Context context, String driverId, String orderId) {
        Intent intent = new Intent().setClass(context, RecordService.class);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            context.startForegroundService(intent);
        } else {
            context.startService(intent);
        }
    }
}
